package com.sz.pc.entity.model;

/**
 * 业务状态码
 */
public enum ResultDataEnum {
    OK(10000,"OK"),
    PARAMS_ERROR(10001,"参数异常"),
    DATA_ERROR(10002,"数据异常"),
    SAVE_FAIL(10003,"保存或更新数据异常"),
    MSG_OVER_LIMIT(10004,"超过每日发送限制,请明天再试"),
    MOBILE_OUT_LIMIT(10005,"只有来贷合伙人才能登录"),
    MSG_MOBILE_ERROR(10006,"验证码错误"),
    MSG_MOBILE_OVERDUE(10007,"您的验证码已过期，请重新获取"),
    MOBILE_VALID(10008,"手机号格式不对"),
    USER_LOCK(10009,"账户冻结中,请联系管理员"),
    USER_ACCOUNT_SHENHE(10010,"账户审核失败"),
	REASON_IS_BLANK(10011,"驳回理由为空"),
	REASON_TOO_LONG(10012,"驳回理由超长"),
	FILE_NOT_EXIT(10013,"文件为空"),
	FILE_MORE_THAN_10M(10014,"文件大小不能超过10M"),
	MORD_THAN_SX_CREDIT(10015,"不能超过申请额度"),
	CAN_NOT_REAPPLY(10016,"非驳回订单，不能重新申请"),
	MOBILE_EXIST(10017,"存在重复的手机号码！"),
	IDCARD_EXIST(10018,"存在重复的身份证号码！"),
	IDCARD_PINFAN(10019,"此身份认证太频繁，请更换借款人"),
	IDCARD_AUTH_FAILURE(10020,"实名认证失败，请检查姓名和身份证号"),
	FAILURE_TOOMUCH(10021,"您今日添加授信人失败次数太多，请明天再试！"),
	TIMES_TOOMUCH(10022,"您今日操作太频繁，请明天再试！"),
	JKR_IN_CREDITING(10023,"该借款人正在授信审批中，请勿重复提交"),
	AGENT_CREDIT_LESS(10024,"代理人可借款额度不足"),
	LOAN_IN_KOUKUAN(10025,"存在正在扣款的订单"),
	FILE_UPLOAD_FAILURE(10026,"文件上传失败"),
	NO_PRODUCT_PAY(10027,"没有默认的还款方式"),
	ALREAD_SUBMIT(10028,"授信记录已经提交"),
	NO_AUTH(10029,"没有操作权限"),
	DANBAO_NOTEMPTY(10030,"担保人姓名关系不能为空"),
	RELATION_CANNOT_SX(10033,"合伙人直系不能申请授信"),
	SELF_CANNOT_SX(10034,"不能授信代理人"),
	PAID_PAIDING(10035,"包含已还或还款中的明细"),
	NOT_FOUND(10036,"服务器网络异常，请联系管理员"),
	SERVER_ERROR(10037,"服务器异常，请联系管理员"),
	NO_PAY_TYPE(10038,"没有对应的产品或还款方式"),
	NO_CONFIRM_PERMISSION(10039,"您没有处理权限，请联系您的合伙人处理"),
	FORBID_CREDIT(10040,"您已被禁止授信新增，请联系您的上级合伙人处理"),
	BEYOND_CREDIT_LIMIT(10041,"您的可授信额度已不足，请联系您的上级合伙人处理"),
	NO_CREDIT_SX_INFO(10042,"您无授信信息，请联系管理员"),
	AGENT_SPOUSE_NO_CREDIT(10043,"合伙人直系亲属不可授信"),
	SPOUSE_NO_LOAN_SAME(10044,"同一个家庭不能重复授信"),
	SPOUSE_IDCARD_ERROR(10045,"配偶实名认证不通过，请核查"),
	SAME_SPOUSE_AND_CREDIT(10046,"配偶身份证与授信人相同，请检查配偶信息"),
	NOT_REPAY_FAILURE(10047,"存在不是还款失败的订单"),
	CANNOT_ADD_SX(10048,"无法添加授信"),
	SPOUSE_IDCARD_EXIST(10049,"配偶身份证已存在！"),
	SPOUSE_MOBILE_EXIST(10049,"配偶手机号已存在！"),
	SPOUSE_LOANER_MOBILE_SAME(10050,"借款人与配偶的手机不能相同"),
	SUPER_AGENT_TIP(10051,"您为高级合伙人，请使用电脑登录www.51ubank.com"),
	ALREADY_AUDITED_OPERATOR(10052,"已经操作，不可重复操作"),
	NOT_EXIST_CREDIT(10053,"授信信息不存在"),
	CREDIT_NUM_ERROR(10054,"授信额度输入格式出错"),
	HAVE_SPACE(10055,"您输入借款人姓名存在空格，请重新输入"),
	OLD_PWD_ERROR(10056,"原始密码错误");

	/**
     * 返回码
     */
    private int code;

    /**
     * 返回结果描述
     */
    private String message;

    ResultDataEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }
    
    public static ResultDataEnum getEnu(String name){
    	for(ResultDataEnum enu :ResultDataEnum.values()){
    		if(enu.name().equals(name)){
    			return enu;
    		}
    	}
    	return null;
    }
    
    public static boolean isOk(ResultDataEnum resultDataEnum){
    	if(resultDataEnum.getCode() == 10000){
    		return true;
    	} 
    	return false;
    }
}
